using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Human
{
    public partial class frm_taodlieu_ng : Form
    {
        Language lan = new Language();
        public frm_taodlieu_ng()
        {
            InitializeComponent();
            lan.Read_Language_to_Xml(this.Name.ToString(), this);
            lan.Changelanguage_to_English(this.Name.ToString(), this);
        }

        public string thang = "", nam = "",mmyy="";
        public bool closes = false;

        private void frm_taodlieu_ng_Load(object sender, EventArgs e)
        {
            
            thang = DateTime.Now.Month.ToString().PadLeft(2,'0');
            nam = DateTime.Now.Year.ToString();
            mmyy = thang + nam.Substring(2,2);
            txtThang.Text = thang;
            txtThang.Focus();
            txtNam.Text = nam;
        }

        private void txtNam_KeyPress(object sender, KeyPressEventArgs e)
        {
            if ((e.KeyChar < '0' || e.KeyChar > '9') && e.KeyChar != '\b')
                e.KeyChar = '\0';
        }

        private void txtNam_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                SendKeys.Send("{Tab}");
        }

        private void txtThang_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                SendKeys.Send("{Tab}");
        }
        private void cmdOk_Click(object sender, EventArgs e)
        {            
            closes = true;
            mmyy = txtThang.Text.PadLeft(2, '0') + txtNam.Text.Substring(2,2);
            this.Close();
        }

        private void cmdCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}